<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/




/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

//Route::group(['middleware' => 'web'],function(){
    Route::get('/',['as'=>'Home.Index.index','uses'=>'HomeController@index']);
    Route::get('about',['as' => 'Home.Index.about','uses' => 'HomeController@about']);
    Route::get('book',['as' => 'Home.Index.book','uses' => 'HomeController@book']);
    Route::get('contact',['as' => 'Home.Index.contact','uses' => 'HomeController@contact']);
    Route::get('friend',['as' => 'Home.Index.friend','uses' => 'HomeController@friend']);
    Route::get('join',['as' => 'Home.Index.join','uses' => 'HomeController@join']);
    Route::get('news',['as' => 'Home.Index.news','uses' => 'HomeController@news']);
    Route::get('news_details',['as' => 'Home.Index.newsDetails','uses' => 'HomeController@newsDetails']);
    Route::get('product',['as' => 'Home.Index.product','uses' => 'HomeController@product']);
    Route::get('product_details',['as' => 'Home.Index.productDetails','uses' => 'HomeController@productDetails']);
    Route::get('application_field',['as' => 'Home.Index.applicationField','uses' => 'HomeController@applicationField']);

//});

Route::group(['prefix' => 'en','middleware' => 'web'],function(){
    Route::get('/',['as'=>'Home.Index.enIndex','uses'=>'EnHomeController@enIndex']);
    Route::get('about',['as' => 'Home.Index.enAbout','uses' => 'EnHomeController@enAbout']);
    Route::get('book',['as' => 'Home.Index.enBook','uses' => 'EnHomeController@enBook']);
    Route::get('contact',['as' => 'Home.Index.enContact','uses' => 'EnHomeController@enContact']);
    Route::get('friend',['as' => 'Home.Index.enFriend','uses' => 'EnHomeController@enFriend']);
    Route::get('join',['as' => 'Home.Index.enJoin','uses' => 'EnHomeController@enJoin']);
    Route::get('news',['as' => 'Home.Index.enNews','uses' => 'EnHomeController@enNews']);
    Route::get('enNews_details',['as' => 'Home.Index.enNewsDetails','uses' => 'EnHomeController@enNewsDetails']);
    Route::get('product',['as' => 'Home.Index.enProduct','uses' => 'EnHomeController@enProduct']);
    Route::get('enProduct_details',['as' => 'Home.Index.enProductDetails','uses' => 'EnHomeController@enProductDetails']);
    Route::get('enApplicationField',['as' => 'Home.Index.enApplicationField','uses' => 'EnHomeController@enApplicationField']);

});

Route::group(['middleware' => ['web']], function () {

    Route::group(['prefix'=>'admin'],function(){
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        Route::get('user-list',['as' => 'Admin.Home.userList', 'uses' => 'AdminController@userList']);

        Route::get('banner-list',['as' => 'Admin.Home.bannerList', 'uses' => 'AdminController@bannerList']);
        Route::get('banner-set',['as' => 'Admin.Home.bannerSet', 'uses' => 'AdminController@bannerSet']);
        Route::get('en-banner-list',['as' => 'Admin.Home.enBannerList', 'uses' => 'AdminController@enBannerList']);
        Route::get('en-banner-set',['as' => 'Admin.Home.enBannerSet', 'uses' => 'AdminController@enBannerSet']);

        Route::get('change-Pwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        Route::get('admin-list',['as' => 'Admin.Home.adminList' , 'uses' => 'AdminController@adminList']);
        Route::get('admin-set',['as' => 'Admin.Home.adminSet' , 'uses' => 'AdminController@adminSet']);
        Route::get('classify-list',['as' => 'Admin.Home.classifyList' , 'uses' => 'AdminController@classifyList']);

        Route::get('webSite-info',['as' => 'Admin.Home.webSiteInfo' , 'uses' => 'AdminController@webSiteInfo']);
        Route::get('en_webSite-info',['as' => 'Admin.Home.enWebSiteInfo' , 'uses' => 'AdminController@enWebSiteInfo']);

        Route::get('footer-menu',['as' => 'Admin.Home.footerMenu' , 'uses' => 'AdminController@footerMenu']);
        Route::get('en-footer-menu',['as' => 'Admin.Home.enFooterMenu' , 'uses' => 'AdminController@enFooterMenu']);

        Route::get('application-field-list',['as' => 'Admin.Home.applicationFieldList' , 'uses' => 'AdminController@applicationFieldList']);
        Route::get('application-field-set',['as' => 'Admin.Home.applicationFieldSet' , 'uses' => 'AdminController@applicationFieldSet']);
        Route::get('en-application-field-list',['as' => 'Admin.Home.enApplicationFieldList' , 'uses' => 'AdminController@enApplicationFieldList']);
        Route::get('en-application-field-set',['as' => 'Admin.Home.enApplicationFieldSet' , 'uses' => 'AdminController@enApplicationFieldSet']);


        Route::get('goods-list',['as' => 'Admin.Home.goodsList' , 'uses' => 'AdminController@goodsList']);
        Route::get('en-goods-list',['as' => 'Admin.Home.enGoodsList' , 'uses' => 'AdminController@enGoodsList']);
        Route::get('goods-set',['as' => 'Admin.Home.goodsSet' , 'uses' => 'AdminController@goodsSet']);
        Route::get('en-goods-set',['as' => 'Admin.Home.enGoodsSet' , 'uses' => 'AdminController@enGoodsSet']);
        Route::get('goods-classify-list',['as' => 'Admin.Home.goodsClassifyList' , 'uses' => 'AdminController@goodsClassifyList']);
        Route::get('en-goods-classify-list',['as' => 'Admin.Home.enGoodsClassifyList' , 'uses' => 'AdminController@enGoodsClassifyList']);

        Route::get('news-list',['as' => 'Admin.Home.newsList' , 'uses' => 'AdminController@newsList']);
        Route::get('en-news-list',['as' => 'Admin.Home.enNewsList' , 'uses' => 'AdminController@enNewsList']);
        Route::get('news-set',['as' => 'Admin.Home.newsSet' , 'uses' => 'AdminController@newsSet']);
        Route::get('en-news-set',['as' => 'Admin.Home.enNewsSet' , 'uses' => 'AdminController@enNewsSet']);
        Route::get('news-classify-list',['as' => 'Admin.Home.newsClassifyList' , 'uses' => 'AdminController@newsClassifyList']);
        Route::get('en-news-classify-list',['as' => 'Admin.Home.enNewsClassifyList' , 'uses' => 'AdminController@enNewsClassifyList']);

        Route::get('about-us-list',['as' => 'Admin.Home.aboutUsList' , 'uses' => 'AdminController@aboutUsList']);
        Route::get('en-about-us-list',['as' => 'Admin.Home.enAboutUsList' , 'uses' => 'AdminController@enAboutUsList']);
        Route::get('about-us-set',['as' => 'Admin.Home.aboutUsSet' , 'uses' => 'AdminController@aboutUsSet']);
        Route::get('en-about-us-set',['as' => 'Admin.Home.enAboutUsSet' , 'uses' => 'AdminController@enAboutUsSet']);
        Route::get('about-us-classify-list',['as' => 'Admin.Home.aboutUsClassifyList' , 'uses' => 'AdminController@aboutUsClassifyList']);
        Route::get('en-about-us-classify-list',['as' => 'Admin.Home.enAboutUsClassifyList' , 'uses' => 'AdminController@enAboutUsClassifyList']);

        Route::get('human-res-list',['as' => 'Admin.Home.humanResList' , 'uses' => 'AdminController@humanResList']);
        Route::get('en-human-res-list',['as' => 'Admin.Home.enHumanResList' , 'uses' => 'AdminController@enHumanResList']);
        Route::get('human-res-set',['as' => 'Admin.Home.humanResSet' , 'uses' => 'AdminController@humanResSet']);
        Route::get('en-human-res-set',['as' => 'Admin.Home.enHumanResSet' , 'uses' => 'AdminController@enHumanResSet']);
        Route::get('human-res-classify-list',['as' => 'Admin.Home.humanResClassifyList' , 'uses' => 'AdminController@humanResClassifyList']);
        Route::get('en-human-res-classify-list',['as' => 'Admin.Home.enHumanResClassifyList' , 'uses' => 'AdminController@enHumanResClassifyList']);

    });

    Route::group(['prefix'=>'api', 'namespace'=>'Api','middleware' => ['cors']],function(){
        Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
            Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
            Route::post('auth/change-pwd',['as'=>'Api.Admin.Auth.changePassword','uses'=>'AuthController@changePassword']);
            Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
            Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
            Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
            Route::post('sys/setAdmin',['as' => 'Api.Admin.sys.setAdmin','uses' => 'SystemController@setAdmin']);
            Route::post('sys/delAdmin',['as'=>'Api.Admin.sys.delAdmin','uses'=>'SystemController@delAdmin']);
            Route::post('sys/addClassify',['as'=>'Api.Admin.sys.addClassify','uses'=>'SystemController@addClassify']);
            Route::post('sys/delClassify',['as'=>'Api.Admin.sys.delClassify','uses'=>'SystemController@delClassify']);
            Route::post('sys/setWebSiteInfo',['as'=>'Api.Admin.sys.setWebSiteInfo','uses'=>'SystemController@setWebSiteInfo']);
            Route::post('sys/setEnWebSiteInfo',['as'=>'Api.Admin.sys.setEnWebSiteInfo','uses'=>'SystemController@setEnWebSiteInfo']);
            Route::post('sys/addFooterMenu',['as'=>'Api.Admin.sys.addFooterMenu','uses'=>'SystemController@addFooterMenu']);
            Route::post('sys/addEnFooterMenu',['as'=>'Api.Admin.sys.addEnFooterMenu','uses'=>'SystemController@addEnFooterMenu']);
            Route::post('sys/delFooterMenu',['as'=>'Api.Admin.sys.delFooterMenu','uses'=>'SystemController@delFooterMenu']);
            Route::post('sys/delEnFooterMenu',['as'=>'Api.Admin.sys.delEnFooterMenu','uses'=>'SystemController@delEnFooterMenu']);
            Route::post('sys/setGoods',['as'=>'Api.Admin.sys.setGoods','uses'=>'SystemController@setGoods']);
            Route::post('sys/delGoods',['as'=>'Api.Admin.sys.delGoods','uses'=>'SystemController@delGoods']);
            Route::post('sys/addAllClassify',['as'=>'Api.Admin.sys.addAllClassify','uses'=>'SystemController@addAllClassify']);
            Route::post('sys/delAllClassify',['as'=>'Api.Admin.sys.delAllClassify','uses'=>'SystemController@delAllClassify']);
            Route::post('sys/setNews',['as'=>'Api.Admin.sys.setNews','uses'=>'SystemController@setNews']);
            Route::post('sys/delNews',['as'=>'Api.Admin.sys.delNews','uses'=>'SystemController@delNews']);
            Route::post('sys/setAboutUs',['as'=>'Api.Admin.sys.setAboutUs','uses'=>'SystemController@setAboutUs']);
            Route::post('sys/delAboutUs',['as'=>'Api.Admin.sys.delAboutUs','uses'=>'SystemController@delAboutUs']);
            Route::post('sys/setHumanRes',['as'=>'Api.Admin.sys.setHumanRes','uses'=>'SystemController@setHumanRes']);
            Route::post('sys/delHumanRes',['as'=>'Api.Admin.sys.delHumanRes','uses'=>'SystemController@delHumanRes']);
            Route::post('sys/setApplicationField',['as'=>'Api.Admin.sys.setApplicationField','uses'=>'SystemController@setApplicationField']);
            Route::post('sys/delApplicationField',['as'=>'Api.Admin.sys.delApplicationField','uses'=>'SystemController@delApplicationField']);

        });

        Route::group(['prefix' => 'wx'],function(){
            Route::any('getJsApiPacket',['as'=>'Api.Wechat.getJsApiPacket','uses'=>'WechatController@getJsApiPacket']);
        });

        Route::group(['prefix' => 'file'],function(){
            Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
            Route::post('upload-audio',['as'=>'Api.File.uploadAudio','uses'=>'ImageController@uploadAudio']);
            Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
            Route::get('reloadImages',['as'=>'Api.File.reloadImages','uses'=>'ImageController@reloadImages']);
            Route::post('uploadBase64Image',['as'=>'Api.File.uploadBase64Image','uses'=>'ImageController@uploadBase64Image']);
            Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        });

        Route::group(['prefix' => 'audio'],function(){
            Route::get('upload-audio/{audio_id}',['as'=>'Api.Audio.getAudioUrl','uses'=>'AudioController@getAudioUrl']);
       });

        Route::group(['prefix' => 'auth'],function(){
            Route::get('wxLogin',['as'=>'Api.Auth.wxLogin','uses'=>'AuthController@wxLogin']);
            Route::get('goToUrl',['as'=>'Api.Auth.goToUrl','uses'=>'AuthController@goToUrl']);
            Route::any('wechatCallback',['as'=>'Api.Auth.wechatCallback','uses'=>'AuthController@wechatCallback']);
            Route::post('buildOnlineMessage',['as'=>'Api.Auth.buildOnlineMessage','uses'=>'AuthController@buildOnlineMessage']);
        });

        Route::group(['prefix' => 'other'],function(){
            Route::get('getBannerList',['as'=>'Api.Order.getBannerList','uses'=>'OtherController@getBannerList']);
        });
    });
});
